/**
 * @author		Sergey Suzdalskiy
 * @e-mail:		sergey.suzdalskiy@gmail.com
 */
package ua.kiev.gcore.ui.controls
{
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.filters.GlowFilter;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	
	
	
	public class ButtonMovieClip extends Button
	{
		private const BUTTON_UP_FRAME:String = "up";
		private const BUTTON_DOWN_FRAME:String = "down";
		private const BUTTON_OVER_FRAME:String = "over";
		private const BUTTON_DISABLE_FRAME:String = "disable";
		
//		protected var autoSize:Boolean;	
//		protected var isMouseDown:Boolean;
		
		public function ButtonMovieClip(UID:String, BackGround:MovieClip, Label:TextField, textValue:String, MouseClickFunction:Function)
		{
			super(UID, BackGround, Label, textValue, MouseClickFunction);			
			if(backGround){
				(backGround as MovieClip).gotoAndStop(BUTTON_UP_FRAME);
			}
		}
		
		override public function set State(value:int):void{
			super.State = value;
			
			if(backGround){
				switch(State){
					case BUTTON_UP_STATE:
						(backGround as MovieClip).gotoAndStop(BUTTON_UP_FRAME);
						break;
					case BUTTON_DOWN_STATE:
						(backGround as MovieClip).gotoAndStop(BUTTON_DOWN_FRAME);
						break;
					case BUTTON_OVER_STATE:
						(backGround as MovieClip).gotoAndStop(BUTTON_OVER_FRAME);
						break;
					case BUTTON_DISABLE_STATE:
						(backGround as MovieClip).gotoAndStop(BUTTON_DISABLE_FRAME);
						break;					
				}
			}
		}
	}
}